﻿package {
	import flash.display.*;
	import flash.events.*;
	import flash.ui.*;
	public class Main extends MovieClip {
		private var colors:Array;
		public function Main() {
			colors=[0xFF3533,0xFDD200,0x62C2F8,0xAAC800];
			this.addEventListener(Event.ADDED_TO_STAGE,addHd);
			//右键菜单
			var m:ContextMenu = new ContextMenu();
			m.hideBuiltInItems();
			var a:ContextMenuItem = new ContextMenuItem("MouseFollow - CenFun.Com");
			m.customItems.push(a);
			this.contextMenu = m;
		}
		private function addHd(e:Event):void {
			stage.addEventListener(MouseEvent.MOUSE_MOVE,moveHd);
		}
		private function moveHd(e:Event):void {
			if (Math.random() > 0.5) {
				var dot:Dot=new Dot(colors[Math.floor(Math.random() * colors.length)],3,10,1);
				addChild(dot);
			}
		}
	}
}